Hi Tom,
I have something unusual going on with a gcode
program.
The program includes an M102 program to change
tools...
#include "KMotionDef.h"
main()
{
ClearBit(42);
Delay_sec(1.0);
EnableAxis(2);
while (!CheckDone(2));
EnableAxis(3);
while (!CheckDone(3));
MoveRelAtVel(3,15500.0,5000.0);
while (!CheckDone(3));
MoveRelAtVel(2,8333.0,3000.0); // 2 pos'n
while (!CheckDone(2));
MoveRelAtVel(3,-16500.0,4000.0); // lower
jack
while (!CheckDone(3));
DisableAxis(2);
DisableAxis(3);
Delay_sec(0.5);
SetBit(42);
}
This M102 is near the end of the program...
...
G1 X6.42287 Y5.53505
G1 X6.39782 Y5.50244
G1 X6.29443 Y5.29784
G0 X6 Y0.5
M5 (turn spindle off)
M102 (change turret back to roller #2)
M30 (rewind program)
but doesn't seem to execute fully when it is embedded in
the gcode. If I enter the M102 into the screen window and
"send" it the program runs fine. When it is within the
gcode program it seems to miss the 2 position move for
axis 2. Because the system is open loop there is no
feedback that the motion has completed. Even stranger is
if this M code is placed higher up in the gcode it seems
to execute just fine. Would there be some kind of conflict
between the M102 and the M30 rewind commands?
Thanks for your help,
David.